package com.woniuxy.book.util;

import lombok.Data;

@Data
public class Result {
    private String message;
    private Integer code;
    private Object data;

    public Result(Integer code,String message){
        this.code=code;
        this.message=message;
    }

    public Result(Integer code,String message,Object data){
        this.code=code;
        this.message=message;
        this.data=data;
    }

    public static Result success(String message,Object data){
        return new Result(200,message,data);
    }

    public static Result fail(String message){
        return new Result(500,message);
    }

}
